package client.comm.baoding.ui

import client.comm.baoding.BaseMiddleActivity
import client.comm.baoding.R
import client.comm.baoding.adapter.page.GuaDan2FragmentPageAdapter
import client.comm.baoding.adapter.page.Zcjl2FragmentPageAdapter
import client.comm.baoding.databinding.ActivityGuadan2Binding
import client.comm.baoding.databinding.ActivityZcjl2Binding
import client.comm.baoding.ui.vm.TradeDetailModel
import client.comm.baoding.ui.vm.ZcjlViewModel

/**
 * 资产记录
 */
class MyGuaDan2Activity : BaseMiddleActivity<TradeDetailModel, ActivityGuadan2Binding>() {

    var goods_id: String? = null

    override fun getLayout(): Int {
        return R.layout.activity_guadan2
    }

    val adapter: GuaDan2FragmentPageAdapter by lazy {
        GuaDan2FragmentPageAdapter(supportFragmentManager)
    }

    override fun initViewModel(): TradeDetailModel = createViewModel()

    override fun initView() {
        binding.event = this
        goods_id = intent.getStringExtra("goodsId")

        binding.viewPager.adapter = adapter
        binding.tabLayout.setupWithViewPager(binding.viewPager)
//        when (intent.getIntExtra("index", 0)) {
//            0 -> {
////                binding.tabWrap.getChildAt(0).isSelected = true
//            }
//            1 -> {
//                binding.viewPager.postDelayed({
//                    binding.viewPager.setCurrentItem(1, false)
//                }, 20)
//            }
//            2 -> {
//                binding.viewPager.postDelayed({
//                    binding.viewPager.setCurrentItem(2, false)
//                }, 20)
//            }
//        }

    }

}